package model.characters;


public class WeaponDecorator extends CharacterDecorator {

	public WeaponDecorator(CharacterInterface player) {
		super(player);
		player.getCurrentWeapon().getRegion().x = getHand().x + 10;
	}

	@Override
	public void update() {
		character.update();
		
		if(getDirection()>0){
			getHand().x = getRegion().x+getRegion().width;
			getCurrentWeapon().getRegion().x = getHand().x + 10;
		}
		if(getDirection()<0){
			getHand().x = getRegion().x-getHand().width;
			getCurrentWeapon().getRegion().x = getHand().x + 10 - getCurrentWeapon().getRegion().width;
		}
		getHand().y = (getRegion().y + 30) ;
		getCurrentWeapon().getRegion().y = getHand().y;
	}

}
